package dao.rowmapper;

import entity.User;
import template.callback.RowMapper;

import java.sql.ResultSet;

public class UserRowMapper implements RowMapper<User> {
    @Override
    public User mapRow(ResultSet rs) throws Exception {
        User user=new User();
        user.setId(rs.getInt("id"));
        user.setUsername(rs.getString("username"));
        user.setPassword(rs.getString("password"));
        user.setSex(rs.getString("sex"));
        user.setEdu(rs.getString("edu"));
        user.setHob(rs.getString("hobbies"));
        user.setDescription(rs.getString("description"));
        user.setRegistDate(rs.getTimestamp("regist_date"));
        user.setStatus(rs.getString("status"));
        return user;
    }
}
